Release 10.1A: OpenEdge Getting Started:
Object-oriented Programming
Defining methods
Within the main block of a class, you implement executable behavior using methods. Progress allows you to define a method as a named block that always begins with the
METHODstatement and always ends with theENDMETHODstatement. A method must have an access modifier ofPUBLIC,PROTECTED, orPRIVATE. Where and how a method can be invoked depends on its access modifier:A method can have parameters and a defined return type (similar to a user-defined function); its return type can also be
VOID, which means that it does not return a value. You can also define a method asFINAL, which means that it cannot be overridden in a subclass. The statements that you include inside a method block can include most of the statements that you include within the block of an internal procedure or user-defined function. For more information on defining methods, see the "Defining methods within a class" section.Comparison with procedure-based programming
Methods generally combine the characteristics of the internal procedures and user-defined functions.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |